home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / shell / xd-2.08 / xd-2 / xd / xd.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-30  |  1.1 KB  |  52 lines

  1. /*                              xd.cc
  2.  
  3.    A C++ main()-frame generated by cpp.im for xd.cc
  4.  
  5. */
  6.  
  7. #include "xd.h"               // program header file
  8.  
  9.  
  10. int main(int argc, char **argv, char **envp)
  11. {
  12.     Args
  13.         args(argc, argv);        // preprocess the arguments
  14. #ifdef DEBUG
  15.     fprintf(stderr, "main():\t args defined\n");
  16. #   endif
  17.  
  18.     Config
  19.         config;                // read the configuration
  20. #ifdef DEBUG
  21.     fprintf(stderr, "main():\t config defined\n");
  22. #   endif
  23.  
  24.     Command
  25.         command(args, config);        // build a command from args
  26. #ifdef DEBUG
  27.     fprintf(stderr, "main():\t command defined\n");
  28. #   endif
  29.                         // and config
  30.  
  31.     if (args.get_count() == 1)        // only one argument ?
  32.     {
  33.                 usage(args);            // usage/copyright on no args
  34.         return (command.write("."));
  35.     }
  36.  
  37.     Match
  38.         match(command.get_pattern(),    // make the matches
  39.             config);
  40. #ifdef DEBUG
  41.     fprintf(stderr, "main():\t match defined\n");
  42. #   endif
  43.  
  44.     Arbiter
  45.         arbiter(match);            // Make the decision
  46. #ifdef DEBUG
  47.     fprintf(stderr, "main():\t arbiter defined\n");
  48. #   endif
  49.  
  50.     return(command.write(arbiter.get_choice()));// Write the cmd to file
  51. }
  52.